﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Doodleberg
{
    class Goal
    {
        public Vector2 position;
        public float radius;

        public Goal(Vector2 pos, float rad)
        {
            position = pos;
            radius = rad;
        }

        public Boolean contains(Vector2 loc)
        {
            return Vector2.Distance(loc, position) < radius;
        }


        public void draw(SpriteBatch spriteBatch)
        {
            float gS = radius / (Global.level.tex_goal.Width / 2);
            spriteBatch.Draw(
                Global.level.tex_goal,
                position,
                null,
                Color.White,
                0.0f,
                new Vector2(Global.level.tex_goal.Width / 2.0f, Global.level.tex_goal.Height / 2.0f),
                new Vector2(gS, gS),
                SpriteEffects.None,
                0.3f);
        }
    }
}
